-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test with modflow6 release and nightly, add test.common module #108
base: develop
Are you sure you want to change the base?
Test with modflow6 release and nightly, add test.common module #108
Conversation
5dd6c1d
to
eb4089a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## develop #108 +/- ##
========================================
Coverage 87.52% 87.52%
========================================
Files 7 7
Lines 521 521
========================================
Hits 456 456
Misses 65 65 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @mwtoews!
pyproject.toml
Outdated
[tool.setuptools.packages.find] | ||
include = ["xmipy", "xmipy.*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is re-added, otherwise "tests" would be added to the .whl package, since it is now a findable module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for fixing that.
I removed it since with packages.find
submodules were not found.
I guess, I should have added "packagename.*" to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now revised with tool.hatch.build.targets.wheel.packages
Current test failures are expected due to MODFLOW-USGS/modflow6#1269 which may hopefully be resolved soon. |
8d3eb94
to
9424342
Compare
9424342
to
9b3b548
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small comments, apart from that looks good to me! :)
- name: Run tests with MODFLOW 6 release | ||
run: | | ||
pytest -vs --cov=xmipy --cov-report=xml tests/ | ||
pytest -v --cov=xmipy --cov-report=xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the -s
?
MODFLOW 6 still crashes for most errors, which means there will be zero output in the CI when tests fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running pytest -s
throws way too much to the console, whereas the default will enable pytest to capture the output, showing more "normal" pytests
outputs. I'll test locally to see if MF6 crashes are adequately captured with/without the flag...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you got reasonable results.
You could try e.g. an invalid configuration option.
Co-authored-by: Hofer-Julian <[email protected]>
I am considering closing this, any objections? |
There are a number of changes related to tests:
tests/common.py
for common test functions that are not fixtures (these are kept atconftest.py
). Note thattests
is now a module, but it is not included by setuptools for installation/packaging.conftest.modflow_lib_path
tocommon.libmf6_path
, based on:LIBMF6
for the direct path to the.so
/.dll
/.dylib
fileMODFLOW_BIN_PATH
to the directory with bothmf6
andlibmf6
(the suffix is determined by platform); this is the default path used by modflowpy/install-modflow-actionlibmf6
is in the same directory asmf6
Re-install modflow6 from the nightly build repo, an re-run tests, amending coverage reportss
option that disable all capturing. This change is done since the capturing by pytest seems to be usually adequate to debug issues (perhaps this wasn't the case before?)The other key change is to only runtest_err_cvg_failure
for libmf6 versions before modflow-6.4.2. (I'll admit that I don't fully understand this change, but this seems to be a deliberate change).Closes #106